import { sequelize } from "./sequelize.js";
import { User } from "../model/User.js";

export const sync = async ()=>{
    await sequelize.sync()
    console.log("数据库连接成功");
    
    await User.sync()
    console.log("导入模型");
    
    let users = [
        {
            uname: '贝吉塔',
            uage: 16
        },
        {
            uname: '卡卡罗特',
            uage:15
        },
        {
            uname: '维斯',
            uage: 14
        },
        {
            uname: '全王',
            uage: 13
        },
        {
            uname: '悟饭',
            uage: 12
        },
    ]
    User.bulkCreate(users);
}